<?php $this->Html->script('jquery-1.7.2.min',false);?>
<?php $this->Html->script('jquery-ui-1.8.22.custom.min',false);?>
<?php //echo $this->Html->css('jquery-ui-1.8.22.custom.css'); ?>
<style type="text/css">
.clientEdit {
	display:flex;
}

</style>
<script>
  $(function() {
    $( "button" )
 	  .button()
      .click(function( event ) {
      	event.preventDefault(); 
		var r = confirm("Esta seguro que desea cambiar el dueño del vehículo?");
		if (r==true){
		  	$('select').prop('disabled', false);
		  	$('button').hide();
	  	}
      	event.preventDefault(); 
      });
  });
</script>

<div class="cars form">
<?php echo $this->Form->create('Car'); ?>
	<fieldset>
		<legend><?php echo __('Editar datos del vehículo'); ?></legend>
	<?php
		echo $this->Form->input('id');
		echo "<div  class='clientEdit' >";
		echo $this->Form->input('client_id', array('label'=>'Cliente', 'disabled'=>true));
		echo "<button>Cambiar dueño</button></div>";
		echo $this->Form->input('marca');
		echo $this->Form->input('modelo');
		echo $this->Form->input('anho',array('label'=>'Año'));
		echo $this->Form->input('chapa');
		echo $this->Form->input('vim');
		
	?>
	</fieldset>
<?php echo $this->Form->end(__('Guardar Cambios')); ?>
</div>
<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Form->postLink(__('Borrar Vehículo'), array('action' => 'delete', $this->Form->value('Car.id')), null, __('Esta seguro que desea borrar el vehículo: %s ?', $this->Form->value('Car.marca').' '.$this->Form->value('Car.modelo'))); ?></li>
		<li><?php  echo $this->Html->link('Volver',"javascript:history.back()"); ?> </li>
	</ul>
</div>
